package com.jswdwsx.esign.cloud.enums


enum class DocNameEnum(val docName: String) {
    UNKNOWN("未知文档"),
    RENT_BACK_DEVICE_AGREEMENT("回租设备转让合同.pdf"),
    MERCHANT_COOPERATION_AGREEMENT("和分享门店合作协议.pdf"),
    PHONE_FINANCING_RENT_AGREEMENT("手机融资租赁合同.pdf"),
    PRE_AUTH_KNOWN_AGREEMENT("业务知情函.pdf"),
    JS_PRE_AUTH_KNOWN_AGREEMENT("江苏业务知情函.pdf")
}

fun String.toDocNameEnum(): DocNameEnum {
    return when (this) {
        DocNameEnum.RENT_BACK_DEVICE_AGREEMENT.docName -> DocNameEnum.RENT_BACK_DEVICE_AGREEMENT
        DocNameEnum.MERCHANT_COOPERATION_AGREEMENT.docName -> DocNameEnum.MERCHANT_COOPERATION_AGREEMENT
        DocNameEnum.PHONE_FINANCING_RENT_AGREEMENT.docName -> DocNameEnum.PHONE_FINANCING_RENT_AGREEMENT
        DocNameEnum.PRE_AUTH_KNOWN_AGREEMENT.docName -> DocNameEnum.PRE_AUTH_KNOWN_AGREEMENT
        DocNameEnum.JS_PRE_AUTH_KNOWN_AGREEMENT.docName -> DocNameEnum.JS_PRE_AUTH_KNOWN_AGREEMENT
        else -> DocNameEnum.UNKNOWN
    }
}